package com.kmxd.ams.infra.arrange.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author ZuoLG
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SystemBO extends BaseBO implements Serializable {

  @Schema(description = "唯一标识")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  @Schema(description = "全宗id")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long fondsId;

  @Schema(description = "全宗号")
  private String fondsCode;

  @Schema(description = "全宗名称")
  private String fondsName;

  @Schema(description = "父标识(导入专用)")
  @JsonSerialize(using = ToStringSerializer.class)
  private String pid;

  @Schema(description = "标识(导入专用)")
  private String did;

  @Schema(description = "盒关联ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private Long boxId;

  @Schema(description = "项目关联ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private Long projId;

  @Schema(description = "案卷关联ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private Long volId;

  @Schema(description = "来源主键")
  private String rid;

  @Schema(description = "来源名称")
  private String appId;

  @Schema(description = "来源人")
  private String creator;

  @Schema(description = "来源人名称")
  private String creatorName;

  @Schema(description = "所属部门")
  private String department;

  @Schema(description = "所属部门ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long departmentId;

  @Schema(description = "密级到期年限")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date securityYear;

  @Schema(description = "保管到期年限")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date expireYear;

  @Schema(description = "来源类型")
  private String sourceType;

  @Schema(description = "库存量")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer storageNum;

  @Schema(description = "创建角色类型")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long manageStatus;

  @Schema(description = "状态")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer status;

  @Schema(description = "MD5校验值")
  private String md5;

  @Schema(description = "国密sm3")
  private String sm3;

  @Schema(description = "存放地点")
  private String position;

  /** 删除状态(0-正常,1-已删除) */
  @Schema(description = "删除状态(0-正常,1-已删除)")
  @TableLogic
  private Integer delFlag;

  @Schema(description = "创建人id")
  @TableField(fill = FieldFill.INSERT)
  @JsonSerialize(using = ToStringSerializer.class)
  private Long createBy;

  @Schema(description = "创建时间")
  @TableField(fill = FieldFill.INSERT)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @Schema(description = "编辑人ID")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  @JsonSerialize(using = ToStringSerializer.class)
  private Long updateBy;

  @Schema(description = "编辑时间")
  @TableField(fill = FieldFill.INSERT_UPDATE)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;

  @Schema(description = "数据节点条件")
  @TableField(exist = false)
  private String dataCondition;
}
